﻿using System.ComponentModel;

namespace DnnDash.SimplePhoneApp.ViewModel
{
    public abstract class ViewModelBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        /// <summary>
        /// Raise the PropertyChanged event and pass along the property that changed
        /// </summary>
        protected void RaisePropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        /// <summary>
        /// Public parameterless constructor required for navigation
        /// </summary>
        public ViewModelBase()
        {
        }
    }
}
